<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <meta name="description" content="">
    <meta http-equiv="x-dns-prefetch-control" content="on">

    <title>已就位-待出发</title>
    <link href="../../css/css.css" rel="stylesheet" type="text/css">
    <script src="../../js/jquery-v1.11.2.min.js"></script>
    <script src="../../js/driver.js"></script>
    <script src="../../js/common.js"></script>
</head>
<body>
<section class="itemgroup mt10 p15">
    <div class="oneitem_xl" id="startAddr">
        <i class="iconfont mr5 green icon28">&#xe70d;</i>
        共和新路3288弄3号
    </div>
    <div class="oneitem_xl">
        <label class="gray mr5">联系人:</label>
        <span id="consignName"></span>
        <i class="iconfont rightsmallicon">&#xe6db;</i>
        <label class="right" id="consignMobile"></label>
    </div>
</section>
<section class="p15 subtitle_xl mt10">下一站</section>
<section class="itemgroup p15">
    <div class="oneitem_xl">
        <label class="gray">卸货地</label>
        <label class="right" id="endAddr"></label>
    </div>
    <div class="oneitem_xl">
        <label class="gray">联系人</label>
        <i class="iconfont rightsmallicon">&#xe6db;</i>
        <label class="right" id="consignName2"></label>
    </div>
    <div class="oneitem_xl">
        <label class="gray">预计到达时间</label>
        <label class="right" id="costTime">0分钟</label>
    </div>
</section>
<section class="sale_info_xl">实际费用可能因实际行驶里程/等候时间等因素差异</section>
<section class="bottomarea">
    <button type="button" class="btn bottomonebtn_xl" id="goonBid4" onclick="goonBid4()">出发</button>
</section>
<script type="text/javascript">
    $(function () {
        //token验证
        checkDriverToken();
    });
    $(document).ready(function () {
        var waybillId = GetArgsFromHref("waybillId");
        var url = _global.serverHost + "/driver/goon_bid3.htm";
        var data = {waybillId: waybillId};
        _callAjaxRequest(url, data, startBidBack);

        function startBidBack(data) {
            $("#startAddr").html('<i class="iconfont mr5 green icon20">&#xe70d;</i>' + data.waybill.startAddr);
            $("#endAddr").html(data.waybill.endAddr);
            $("#consignName").html(data.waybill.consignName);
            $("#consignName2").html(data.waybill.consignName);
            $("#consignMobile").html(data.waybill.consignMobile);
            $("#costTime").html(data.waybill.costTime + "分钟");
        }

        $("#goonBid4").attr("onclick", "goonBid4('" + waybillId + "')");
    });
    function goonBid4(waybillId) {
        var url = _global.serverHost + "/driver/check_goon_bid3.htm";
        var data = {waybillId: waybillId,driverUuid: getCookie("driverUuid")};
        _callAjaxRequest(url, data, goonBid4Back);
    }

    function goonBid4Back(data) {
        if (data.code == "1") {
            window.location.href = "../start_bid/goon_bid4.html?waybillId=" + data.waybillId;
        } else {
            alert(data.message);
        }
    }
</script>
</body>
</html>